//
//  TransparentNavBarVC.swift
//  JTYP
//
//  Created by Groot on 2017/11/23.
//  Copyright © 2017年 inspur. All rights reserved.
//

class TransparentNavBarVC: UIViewController {
    var statusBarShouldLight = true
    
    override var preferredStatusBarStyle: UIStatusBarStyle {
        if statusBarShouldLight {
            return .lightContent
        } else {
            return .default
        }
    }
    
    override func viewWillAppear(_ animated: Bool) {
        // 解决滑动返回，取消后导航栏消失的问题
        navigationController?.navigationBar.barStyle = .black
        navigationController?.setNavigationBarHidden(true, animated: animated)
        super.viewWillAppear(animated)
        
    }
    override func viewWillDisappear(_ animated: Bool) {
        navigationController?.navigationBar.barStyle = .default
        navigationController?.setNavigationBarHidden(false, animated: animated)
        super.viewWillDisappear(animated)
    }
}
